#! /bin/bash

set -e

sed -i -e 's/^#Port 22/Port 5000/' -e 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && systemctl restart sshd

#更新镜像源为华为云镜像源
wget http://mirrors.myhuaweicloud.com/repo/mirrors_source.sh && sh mirrors_source.sh

#安装相关依赖包
yum install -y curl policycoreutils-python-utils openssh-server

#安装Postfix来发送通知邮件
yum install -y postfix && systemctl enable --now postfix

#添加GitLab软件包仓库
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | bash

#安装GitLab
EXTERNAL_URL="http://$1" yum install -y gitlab-ee
